<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/common.css" rel="stylesheet" type="text/css" />

<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet"
	type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>订单详情</title>
</head>
<body>
	<div class="pd-20">
		<div class="cl pb-10 bg-1 bk-gray"> 
			<span class="ml-20 f-24" style="line-height: 60px;">用户订单详情</span>
			<div class="ml-20 mr-20 pb-20 radius" style="background:#fff;">
			<div class=" head-line c-primary pl-20">商品列表</div>
			<div class="mt-20"></div>
				<div class="ml-20 mr-20">
					<table class="table table-border table-bordered radius">
						<thead>
							<tr class="text-c">
								<th>商品ID</th>
								<th>订单ID</th>
								<th>商品名称</th>
								<th>销售价</th>
								<th>价格</th>
								<th>购买数量</th>
								<th>是否优惠</th>
								<th>添加时间</th>
								<th>修改时间</th>
							</tr>
						</thead>
						<tbody>
								<c:forEach items="${dingAsses}" var="dingAss">
								<tr class="text-c">
									<td>${dingAss.product_id}</td>
									<td>${dingAss.did}</td>
									<td>${dingAss.name}</td>
									<td>${dingAss.price}</td>
									<td>${dingAss.money}</td>
									<td>${dingAss.num}</td>
									<td>${dingAss.is_quan == 0 ? '否' : '是'}</td>
									<td>${dingAss.create_time}</td>
									<td>${dingAss.update_time}</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
		</div>
		</div>
	</div>
	
	<div style="padding-left:60px;padding-right:60px;">
		<!-- 订单信息  -->
		<span class="f-20 c-primary">订单信息</span>
			<table class="table table-border table-bordered">
				<tr class="text-c">
					<th class="text-r">订单编号</th>
					<td class="text-l">${dingdan.titles}</td>
					<th class="text-r">订单状态</th>
					<td class="text-l">
						<c:choose>
							<c:when test="${dingdan.enable == 2 || dingdan.enable == 4}">
										已取消
							</c:when>
							<c:when test="${dingdan.enable == 3}">
									已退货
						    </c:when>
							<c:when test="${dingdan.zi_status == 0 && dingdan.zf_type != '3' }">
									未支付
							</c:when>
							<c:when test="${(dingdan.enable == 1 && dingdan.dd_status == 1 && dingdan.zi_status ==1) or (dingdan.enable == 1 && dingdan.dd_status == 1 && dingdan.zi_status ==0 && dingdan.zf_type == 3) }">
								待处理
							</c:when>
							<c:when test="${dingdan.enable == 5}">
								已完成
							</c:when>
							<c:when test="${dingdan.spstatus < 4}">
								正在处理
							</c:when>
							<c:when test="${dingdan.spstatus > 3}">
								配送中
							</c:when>
							<c:otherwise>
								未知
							</c:otherwise>
						</c:choose>
					</td>
					<th class="text-r">支付方式</th>
					<td class="text-l">
						<c:choose>
								<c:when test="${dingdan.zi_status == 0 && dingdan.zf_type != '3'}">
									未支付
								</c:when>
								<c:when test="${dingdan.zf_type == '0'}">
									余额支付
								</c:when>
								<c:when test="${dingdan.zf_type == '1'}">
									支付宝
								</c:when>
								<c:when test="${dingdan.zf_type == '2'}">
									微信
								</c:when>
								<c:when test="${dingdan.zf_type == '3'}">
									货到付款
								</c:when>
								<c:when test="${dingdan.zf_type == '0,1'}">
									余额支付+支付宝
								</c:when>
								<c:when test="${dingdan.zf_type == '0,2'}">
									余额支付+微信
								</c:when>
								
						</c:choose>
					</td>
				</tr>
			</table>
			<!-- 订单信息 end  -->
			
		<div class="mt-20"></div>
		<!-- 用户信息 -->
		<span class="f-20 c-primary">用户信息</span>
		<table class="table table-border table-bordered">
				<tr class="text-c">
					<th class="text-r">用户名</th>
					<td class="text-l">${dingdan.uid}</td>
					<th class="text-r">收货姓名</th>
					<td class="text-l">${dingdan.name}</td>
					<th class="text-r">收货电话</th>
					<td class="text-l">${dingdan.mobile }</td>
					<th class="text-r">收货地址</th>
					<td class="text-l">${dingdan.address}</td>
				</tr>
		</table>
		<!-- 用户信息 end -->
		
		<div class="mt-20"></div>
		<!-- 配送信息 -->
		<span class="f-20 c-primary">配送信息</span>
		<table class="table table-border table-bordered">
				<tr class="text-c">
					<th class="text-r">指定配送时间</th>
					<td class="text-l">${dingdan.senddate}</td>
					<th class="text-r">送达时间</th>
					<td class="text-l">${dingdan.arrive_user_time}</td>
					<th class="text-r">配送员</th>
					<td class="text-l">${dingdan.c_tname }</td>
					<th class="text-r">配送员手机号</th>
					<td class="text-l">${dingdan.c_mob }</td>
				</tr>
		</table>
		<!-- 配送信息 end-->
		
		<div class="mt-20"></div>
		<!-- 结算信息 -->
		<span class="f-20 c-primary">结算信息</span>
		<table class="table table-border table-bordered">
				<tr class="text-c">
					<td class="text-l">订单总额</td>
					<td class="text-l">订单应付金额</td>
					<td class="text-l">商品总额</td>
					<td class="text-l">现金支付</td>
					<td class="text-l">第三方支付</td>
					<td class="text-l">余额支付</td>
					<td class="text-l">运费</td>
					<td class="text-l">优惠券金额</td>
					<td class="text-l">支付方式</td>
				</tr>
				<tr class="text-c">
					<td class="text-l">${dingdan.money}</td>
					<td class="text-l">${dingdan.paymoney}</td>
					<td class="text-l">${dingdan.sumgoodsprice}</td>
					<td class="text-l">
						<c:choose>
							<c:when test="${dingdan.zf_type == '3'}"><!-- 只能货到付款才有现金支付金额 -->
								${dingdan.paymoney}
							</c:when>
							<c:otherwise>
								0.00
							</c:otherwise>
						</c:choose>
					</td>
					<td class="text-l">
						<c:choose>
							<c:when test="${dingdan.zi_status == 1}">
								${dingdan.onlinPayMoney}
							</c:when>
							<c:otherwise>
								0.00
							</c:otherwise>
						</c:choose>
					</td>
					<td class="text-l">${dingdan.remainmoney}</td>
					<td class="text-l">${dingdan.sendfee}</td>
					<td class="text-l">${dingdan.cashed}</td>
					<td class="text-l">
						<c:choose>
							<c:when test="${dingdan.zi_status == 0}">
								未支付
							</c:when>
							<c:when test="${dingdan.zf_type == '0'}">
								余额支付
							</c:when>
							<c:when test="${dingdan.zf_type == '1'}">
								支付宝
							</c:when>
							<c:when test="${dingdan.zf_type == '2'}">
								微信
							</c:when>
							<c:when test="${dingdan.zf_type == '3'}">
								货到付款
							</c:when>
							<c:when test="${dingdan.zf_type == '0,1'}">
								余额支付+支付宝
							</c:when>
							<c:when test="${dingdan.zf_type == '0,2'}">
								余额支付+微信
							</c:when>
						</c:choose>
					</td>
				</tr>
		</table>
		<!-- 结算信息 end-->
		
		<div class="mt-20"></div>
		<!-- 订单备注 -->
		<span class="f-20 c-primary">订单备注</span>
		<div class=" bg-1 pd-20 radius">
			<div class="col-3 cl">
				<textarea name="bz" id="bz"  class="textarea radius text-l">${dingdan.bz}</textarea>
			</div>
			<div class="cl"></div>
			<div >
				<button class="btn btn-warning radius" onclick="updateBz();">更新备注</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
		<!-- 订单备注 end-->
		
		<div class="mb-20"></div>
	</div>
	
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript">
		var rid = '${dingdan.rid}';
		function updateBz(){
			var bz = $("#bz").val();
			$.post("<%=path%>/backstage/order-update",{"bz":bz,"rid":rid})
			.done(function(msg){
				if (msg.code == "0000"){
					alert("更新成功");
				}else{
					alert(msg.information);
				}
			});
		}
		/* 关闭 */
		function layer_close(){
			var index = parent.layer.getFrameIndex(window.name);
			if (index){//关闭弹出层
				parent.layer.close(index);
			}else{//单独的页面
				history.back();
			}
		}
	</script>
</body>
</html>